package edu.henu.personnel.controller;

import edu.henu.personnel.entity.Talent;
import edu.henu.personnel.service.talent.TalentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @program: PersonnelProject
 * @description: Talent列表控制器
 * @author: zhuyang
 * @create: 2019-04-28 15:27
 */

@Controller
@RequestMapping(value = "/talent")
public class TalentController {

    @Autowired
    TalentService talentService;

    @GetMapping("/talents")
    public String list(Model model) {
        List<Talent> talentList = talentService.getTalentList();
        model.addAttribute("talentList", talentList);
        return "talent/list";
    }

}
